package ie.dkit.semanticPhotoWeb.client.panels;

import ie.dkit.semanticPhotoWeb.client.tools.LoginListener;

import com.google.gwt.user.client.ui.Label;
import com.gwtext.client.widgets.Panel;

/**
 * @author Sebastian Ruehl
 * 
 * This program is free software; you can redistribute it and/or modify it under
 * the terms of the GNU General Public License as published by the Free Software
 * Foundation
 * 
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
 * details.
 * 
 * You should have received a copy of the GNU General Public License along with
 * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
 * Place, Suite 330, Boston, MA 02111-1307 USA
 */
public class StatusPanel extends Panel implements LoginListener {
	private Label m_LoggedInUserLabel;

	public StatusPanel() {
		add(m_LoggedInUserLabel = new Label());
		setHeight(50);  
		setCollapsible(true);  
		setTitle("Status");  
	}

	/*
	 * (non-Javadoc)
	 * @see ie.dkit.semanticPhotoWeb.client.tools.LoginListener#loggedIn(java.lang.String)
	 */
	public void loggedIn(String username) {
		m_LoggedInUserLabel.setText("Currently logged in as: " + username);
	}

	/*
	 * (non-Javadoc)
	 * @see ie.dkit.semanticPhotoWeb.client.tools.LoginListener#loggedOut()
	 */
	public void loggedOut() {
		m_LoggedInUserLabel.setText("Currently not logged in");		
	}
}
